package com.example.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.bean.CmsEnter;
import com.example.demo.mapper.CmsEnterMapper;


@Service
public class CmsEnterService {
	
	@Autowired
	private CmsEnterMapper enterMapper;
	
	public List<CmsEnter> findAll(){
		return enterMapper.selectAll();
	}
	
	public CmsEnter selectById(String id) {
		return enterMapper.selectByPrimaryKey(id);
	}
	
	public int deleteById(String id) {
		return enterMapper.deleteByPrimaryKey(id);
	}
	
	public void saveOrUpdate(CmsEnter enter) {
		enterMapper.updateByPrimaryKey(enter);
	}
	
	public void insert(CmsEnter enter) {
		enterMapper.insert(enter);
	}

}
